<?php
class Partner extends PartnerPeer
{
	function Partner()
	{
		parent::PartnerPeer();
	}
	
	
	public static function getAllPartners($active=1, $orderby='id', $limit=NULL)
	{
		$db = new Database();
		if ($active != 1)
			$active = 0;
		$query = "SELECT id FROM partner WHERE active = $active ORDER BY $orderby ";
		if ($limit)
			$query .= " LIMIT $limit ";
		$db->query($query);
		$result = $db->result;
		$ids = $db->fetch_array($result);
		$Partner_arr = array();
		if ($ids)
			foreach ($ids as $id) {
				$Partner = new Partner();
				$Partner->select($id['id']);
				$Partner_arr[] = $Partner;
			}
			
		return $Partner_arr;
	}
	
}
?>